#ifndef CLIENTTHREAD_H
#define CLIENTTHREAD_H

#include <QObject>
#include <QThread>
#include <QDebug>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QMessageBox>
#include <QSqlError>
#include <QTcpSocket>
#include <QDataStream>
#include "widget.h"

struct group_memb {
    QString membname;
    QString job;
    QString status;
    QByteArray img;
};

class ClientThread : public QThread
{
    Q_OBJECT
public:
    explicit ClientThread(QTcpSocket *client, int r); // 构造函数，需要传一个负责与client通信的socket
    void run() override; // 重写该运行函数

public slots:
    void clientInfoSlot();

signals:
    void returnName(QString clientname, int row);
private:
    QTcpSocket *clientSocket;
    QString clientname; //每一个连接成功的客户端，都要将名字记下
    int row;
};

#endif // CLIENTTHREAD_H
